Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improved Wait Strategy for Publish Transactions #164

Merged
merged 4 commits into from
May 30, 2024
Merged

Conversation

pglombardo
Copy link
Collaborator

@pglombardo pglombardo commented May 24, 2024

Description

With this PR, the package can now more easily wait for QoS > 1 publish packet transactions to complete:

// QoS 1 returns the PUBACK packet
var pubAckPacket = await publishPacket.OnPublishQoS1CompleteTCS.Task.WaitAsync(...)

// QoS 2 returns all packets in transaction
List<ControlPacket> packetList;
packetList = await publishPacket.OnPublishQoS2CompleteTCS.Task.WaitAsync(...)

Much of the leg work of the TaskCompletionSource has been pushed down to the PublishPacket class.

Related Issue

Type of Change

  • 📚 Examples / docs / tutorials / dependencies update
  • 🔧 Bug fix (non-breaking change which fixes an issue)
  • 🥂 Improvement (non-breaking change which improves an existing feature)
  • 🚀 New feature (non-breaking change which adds functionality)
  • 💥 Breaking change (fix or feature that would cause existing functionality to change)
  • 🔐 Security fix

Checklist

  • I've written tests (if applicable) for all new methods and classes that I created. (rake test)
  • I've added documentation as necessary so users can easily use and understand this feature/fix.

@pglombardo pglombardo added the enhancement New feature or request label May 24, 2024
@pglombardo pglombardo changed the title Improve Wait Strategy for Indivudual Packets Improved Wait Strategy for Individual Packets May 24, 2024
@pglombardo pglombardo merged commit 17a273c into main May 30, 2024
8 checks passed
@pglombardo pglombardo deleted the better-events branch May 30, 2024 07:46
@pglombardo pglombardo changed the title Improved Wait Strategy for Individual Packets Improved Wait Strategy for Publish Transactions May 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant